package com.chilly.predicate;

import java.util.Objects;
import java.util.function.Predicate;

/**
 * Created by Chilly Cui on 2020/11/19.
 */
public class Demo {
    public static void main(String[] args) {
        Predicate<String> predicate = (s) -> s.length()>0;
        predicate.test("foo");
        predicate.negate().test("foo");

        Predicate<Boolean> nonNull = Objects::nonNull;
        Predicate<Boolean> isNull = Objects::isNull;

        Predicate<String> isEmpty = String::isEmpty;
        Predicate<String> isNotEmpty = isEmpty.negate();

    }
}
